diff -u --recursive --new-file armul-1.0/Makefile armul-1.0.1/Makefile
--- armul-1.0/Makefile	Tue Dec 13 11:33:34 1994
+++ armul-1.0.1/Makefile	Tue Feb 25 16:42:23 1997
@@ -22,7 +22,7 @@
 
 prefix=/usr/local
 CC = gcc
-CFLAGS = -O2 -D$(ENDIAN) $(CFL) 
+CFLAGS = -pedantic -Wall -O2 -D$(ENDIAN) $(CFL) 
 INSTALL_DIR = $(prefix)/bin
 INSTALL=cp
 
@@ -50,7 +50,7 @@
 	$(INSTALL) armul $(INSTALL_DIR)
 
 armul: $(OBJS) $(MODEL).o
-	$(CC) $(CFLAGS) $(OBJS) $(MODEL).o -o $@ -lm -lXext -lX11
+	$(CC) $(CFLAGS) $(OBJS) $(MODEL).o -o $@ -lm -lXext -lX11 -L/usr/X11R6/lib
 
 clean:
 	rm -f *.o armul core
diff -u --recursive --new-file armul-1.0/armcopro.c armul-1.0.1/armcopro.c
--- armul-1.0/armcopro.c	Fri Dec  9 13:37:19 1994
+++ armul-1.0.1/armcopro.c	Tue Feb 25 17:19:01 1997
@@ -16,6 +16,7 @@
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
 #include "armdefs.h"
+#include "armrdi.h"
 
 extern unsigned ARMul_CoProInit(ARMul_State *state) ;
 extern void ARMul_CoProExit(ARMul_State *state) ;
diff -u --recursive --new-file armul-1.0/armemu.c armul-1.0.1/armemu.c
--- armul-1.0/armemu.c	Fri Dec  9 13:38:37 1994
+++ armul-1.0.1/armemu.c	Tue Feb 25 19:12:46 1997
@@ -17,6 +17,7 @@
 
 #include "armdefs.h"
 #include "armemu.h"
+#include "armsupp.h"
 
 static ARMword GetDPRegRHS(ARMul_State *state, ARMword instr) ;
 static ARMword GetDPSRegRHS(ARMul_State *state, ARMword instr) ;
@@ -1805,7 +1806,7 @@
 #ifdef MODE32
              state->Reg[14] = pc + 4 ; /* put PC into Link */
 #else
-             state->Reg[14] = pc + 4 | ECC | ER15INT | EMODE ; /* put PC into Link */
+             state->Reg[14] = (pc + 4) | ECC | ER15INT | EMODE ; /* put PC into Link */
 #endif
              state->Reg[15] = pc + 8 + POSBRANCH ;
              FLUSHPIPE ;
diff -u --recursive --new-file armul-1.0/armemu.h armul-1.0.1/armemu.h
--- armul-1.0/armemu.h	Fri Dec  9 13:54:16 1994
+++ armul-1.0.1/armemu.h	Tue Feb 25 19:18:50 1997
@@ -139,7 +139,7 @@
                         ASSIGNV((state->Reg[15] & VBIT) != 0) ; \
                         } \
                      else { \
-                        state->Reg[15] = R15PC | (s) & (CCBITS | R15INTBITS | R15MODEBITS) ; \
+                        state->Reg[15] = R15PC | ((s) & (CCBITS | R15INTBITS | R15MODEBITS)) ; \
                         ARMul_R15Altered(state) ; \
                         }
 #define SETABORT(i,m) state->Cpsr = ECC | EINT | (i) | (m)
diff -u --recursive --new-file armul-1.0/arminit.h armul-1.0.1/arminit.h
--- armul-1.0/arminit.h	Thu Jan  1 01:00:00 1970
+++ armul-1.0.1/arminit.h	Tue Feb 25 18:05:49 1997
@@ -0,0 +1 @@
+void ARMul_SelectProcessor(ARMul_State *, unsigned int);
diff -u --recursive --new-file armul-1.0/armos.c armul-1.0.1/armos.c
--- armul-1.0/armos.c	Fri Dec  9 13:40:53 1994
+++ armul-1.0.1/armos.c	Tue Feb 25 17:36:44 1997
@@ -25,6 +25,7 @@
 #include <time.h>
 #include <errno.h>
 #include <string.h>
+#include <unistd.h>
 
 #ifdef __STDC__
 #define unlink(s) remove(s)
@@ -53,6 +54,8 @@
 
 #include "armdefs.h"
 #include "armos.h"
+#include "armrdi.h"
+#include "armsupp.h"
 #ifndef NOOS
 #ifndef VALIDATE
 /* #ifndef ASIM */
diff -u --recursive --new-file armul-1.0/armrdi.c armul-1.0.1/armrdi.c
--- armul-1.0/armrdi.c	Fri Dec  9 13:42:17 1994
+++ armul-1.0.1/armrdi.c	Tue Feb 25 19:03:11 1997
@@ -20,6 +20,7 @@
 #include "armdefs.h"
 #include "armemu.h"
 #include "armos.h"
+#include "arminit.h"
 #include "dbg_cp.h"
 #include "dbg_conf.h"
 #include "dbg_rdi.h"
@@ -96,7 +97,6 @@
 void ARMul_ConsolePrint(ARMul_State *state, const char *format, ...)
 {
   va_list ap;
-  int ch;
   char *str, buf[CONSOLE_PRINT_MAX_LEN];
   int i, j;
   ARMword junk;
diff -u --recursive --new-file armul-1.0/armrdi.h armul-1.0.1/armrdi.h
--- armul-1.0/armrdi.h	Thu Jan  1 01:00:00 1970
+++ armul-1.0.1/armrdi.h	Tue Feb 25 17:18:37 1997
@@ -0,0 +1 @@
+void ARMul_ConsolePrint(ARMul_State *, const char *, ...);
diff -u --recursive --new-file armul-1.0/armsupp.h armul-1.0.1/armsupp.h
--- armul-1.0/armsupp.h	Thu Jan  1 01:00:00 1970
+++ armul-1.0.1/armsupp.h	Tue Feb 25 17:31:51 1997
@@ -0,0 +1,4 @@
+void ARMul_FixCPSR(ARMul_State *, ARMword, ARMword) ;
+void ARMul_FixSPSR(ARMul_State *, ARMword, ARMword) ;
+void ARMul_UndefInstr(ARMul_State *, ARMword) ;
+ARMword ARMul_SwitchMode(ARMul_State *, ARMword, ARMword) ;
diff -u --recursive --new-file armul-1.0/armvirt.c armul-1.0.1/armvirt.c
--- armul-1.0/armvirt.c	Fri Dec  9 14:50:41 1994
+++ armul-1.0.1/armvirt.c	Tue Feb 25 18:34:38 1997
@@ -23,8 +23,9 @@
 freed as they might be needed again. A single area of memory may be
 defined to generate aborts. */
 
-#include "armopts.h"
+/*#include "armopts.h"*/
 #include "armdefs.h"
+#include "armrdi.h"
 
 #ifdef VALIDATE /* for running the validate suite */
 #define TUBE 48 * 1024 * 1024 /* write a char on the screen */
diff -u --recursive --new-file armul-1.0/bag.c armul-1.0.1/bag.c
--- armul-1.0/bag.c	Fri Dec  9 13:46:12 1994
+++ armul-1.0.1/bag.c	Tue Feb 25 18:30:01 1997
@@ -24,6 +24,8 @@
 /* is deleted.                                                      */
 /********************************************************************/
 
+#include <stdlib.h>
+
 #include "bag.h"
 
 #define HASH_TABLE_SIZE 256
diff -u --recursive --new-file armul-1.0/bag.h armul-1.0.1/bag.h
--- armul-1.0/bag.h	Fri Dec  9 13:59:15 1994
+++ armul-1.0.1/bag.h	Tue Feb 25 17:36:13 1997
@@ -28,7 +28,7 @@
 typedef enum {
   NO_ERROR,
   DELETED_OLD_PAIR,
-  NO_SUCH_PAIR,
+  NO_SUCH_PAIR
 } Bag_error;
 
 void BAG_putpair(long first, long second);
diff -u --recursive --new-file armul-1.0/communicate.c armul-1.0.1/communicate.c
--- armul-1.0/communicate.c	Fri Dec  9 13:46:54 1994
+++ armul-1.0.1/communicate.c	Tue Feb 25 18:37:16 1997
@@ -25,6 +25,8 @@
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
+#include <unistd.h>
+
 
 #include "armdefs.h"
 
@@ -79,7 +81,7 @@
 	 this is probably preferable to locking up.  */
       return -1;
       fprintf(stderr, "Waiting for connection from debugger...");
-      debugsock = accept(sockethandle, &isa, &i);
+      debugsock = accept(sockethandle, (struct sockaddr *)&isa, &i);
       if (debugsock < 0) { /* Now we are in serious trouble... */
 	perror("accept");
 	return -1;
@@ -129,7 +131,7 @@
       fprintf(stderr, "Connection with debugger severed.\n");
       return -1;
       fprintf(stderr, "Waiting for connection from debugger...");
-      debugsock = accept(sockethandle, &isa, &i);
+      debugsock = accept(sockethandle, (struct sockaddr *)&isa, &i);
       if (debugsock < 0) { /* Now we are in serious trouble... */
 	perror("accept");
 	return -1;
@@ -181,7 +183,7 @@
   for (i = 0; MYwrite_char(sock, s[i]), s[i]; i++);
 }
 
-int MYread_FPword(int sock, char *putinhere) {
+int MYread_FPword(int sock, unsigned char *putinhere) {
   int i;
   for (i = 0; i < 16; i++)
     if (MYread_char(sock, &putinhere[i]) < 0) return -1;
@@ -197,10 +199,10 @@
 /* Takes n bytes from source and those n bytes */
 /* down to dest */
 int passon(int source, int dest, int n) {
-  char *p;
+  unsigned char *p;
   int i;
   
-  p = (char *) malloc(n);
+  p = (unsigned char *) malloc(n);
   if (!p) {
     perror("Out of memory\n");
     exit(1);
diff -u --recursive --new-file armul-1.0/communicate.h armul-1.0.1/communicate.h
--- armul-1.0/communicate.h	Fri Dec  9 13:59:55 1994
+++ armul-1.0.1/communicate.h	Tue Feb 25 18:53:08 1997
@@ -19,9 +19,9 @@
 void MYwrite_char(int sock, unsigned char c);
 int MYread_word(int sock, ARMword *here);
 void MYwrite_word(int sock, ARMword i);
-void MYwrite_string(int sock, char *s);
-int MYread_FPword(int sock, char *putinhere);
-void MYwrite_FPword(int sock, char *fromhere);
+void MYwrite_string(int sock, unsigned char *s);
+int MYread_FPword(int sock, unsigned char *putinhere);
+void MYwrite_FPword(int sock, unsigned char *fromhere);
 int passon(int source, int dest, int n);
 
 int wait_for_osreply(ARMword *reply);  /* from kid.c */
diff -u --recursive --new-file armul-1.0/kid.c armul-1.0.1/kid.c
--- armul-1.0/kid.c	Fri Dec  9 13:50:19 1994
+++ armul-1.0.1/kid.c	Tue Feb 25 19:00:17 1997
@@ -24,6 +24,8 @@
 
 #include <sys/types.h>
 #include <signal.h>
+#include <unistd.h>
+#include <sys/time.h>
 
 #include "armdefs.h"
 #include "dbg_conf.h"
@@ -31,6 +33,7 @@
 #include "dbg_rdi.h"
 #include "gdbhost.h"
 #include "communicate.h"
+#include "bag.h"
 
 /* The pipes between the two processes */
 extern int mumkid[2];
@@ -61,7 +64,7 @@
   fprintf(stderr, "Terminate ARMulator excecution\n");
 #endif
   if (sig != SIGUSR1) {
-    fprintf("Unsupported signal.\n");
+    fprintf(stderr, "Unsupported signal.\n");
     return;
   }
   armul_rdi.info(RDISignal_Stop, (unsigned long *) 0, (unsigned long *) 0);
@@ -72,7 +75,7 @@
 /* acts as an RDP to RDI interpreter on the front of the ARMulator. */
 /********************************************************************/
 void kid() {
-  char *p, *q;
+  unsigned char *p, *q;
   int i, j, k;
   long outofthebag;
   unsigned char c, d, message;
@@ -82,7 +85,7 @@
   Dbg_ConfigBlock config;
   Dbg_HostosInterface hostif;
   struct Dbg_MCState *MCState;
-  char command_line[256];
+  unsigned char command_line[256];
   struct fd_set readfds;
   
   /* Setup a signal handler for SIGUSR1 */
@@ -162,7 +165,7 @@
       /* Read Memory Address */      
       MYread_word(mumkid[0], &x); /* address */
       MYread_word(mumkid[0], &y); /* nbytes */
-      p = (char *) malloc(y);
+      p = (unsigned char *) malloc(y);
       i = armul_rdi.read(x, p, (unsigned *) &y);
       MYwrite_char(kidmum[1], RDP_Return);
       for (k = 0; k < y; k++)
@@ -177,7 +180,7 @@
       /* Write Memory Address */
       MYread_word(mumkid[0], &x); /* address */
       MYread_word(mumkid[0], &y); /* nbytes */
-      p = (char *) malloc(y);
+      p = (unsigned char *) malloc(y);
       for (k = 0; k < y; k++)
 	MYread_char(mumkid[0], &p[k]);
       i = armul_rdi.write(p, x, (unsigned *) &y);
@@ -192,7 +195,7 @@
       /* Read CPU State */
       MYread_char(mumkid[0], &c); /* mode */
       MYread_word(mumkid[0], &x); /* mask */
-      p = (char *) malloc(4 * RDINumCPURegs);
+      p = (unsigned char *) malloc(4 * RDINumCPURegs);
       i = armul_rdi.CPUread(c, x, (ARMword *) p);
       MYwrite_char(kidmum[1], RDP_Return);
       for (k = 1, j = 0; k != 0x80000000; k *= 2)
@@ -207,7 +210,7 @@
       MYread_char(mumkid[0], &c); /* mode */
       MYread_word(mumkid[0], &x); /* mask */
 
-      p = (char *) malloc(4 * RDINumCPURegs);
+      p = (unsigned char *) malloc(4 * RDINumCPURegs);
       for (k = 1, j = 0; k != 0x80000000; k *= 2)
 	if (k & x) MYread_word(mumkid[0], &(((ARMword *) p)[j++]));
       i = armul_rdi.CPUwrite(c, x, (ARMword *) p);
@@ -220,7 +223,7 @@
       /* Read Co-Processor State */
       MYread_char(mumkid[0], &c); /* CPnum */
       MYread_word(mumkid[0], &x); /* mask */
-      p = q = (char *) malloc(16 * RDINumCPRegs);
+      p = q = (unsigned char *) malloc(16 * RDINumCPRegs);
       i = armul_rdi.CPread(c, x, (ARMword *) p);
       MYwrite_char(kidmum[1], RDP_Return);
       for (k = 1, j = 0; k != 0x80000000; k *= 2, j++)
@@ -243,7 +246,7 @@
       /* Write Co-Processor State */
       MYread_char(mumkid[0], &c); /* CPnum */
       MYread_word(mumkid[0], &x); /* mask */
-      p = q = (char *) malloc(16 * RDINumCPURegs);
+      p = q = (unsigned char *) malloc(16 * RDINumCPURegs);
       for (k = 1, j = 0; k != 0x80000000; k *= 2, j++)
 	if (k & x) {
 	  if ((c == 1 || c == 2) && k <= 128) {
@@ -387,7 +390,7 @@
 	  break;
 
 	default:
-	  fprintf (stderr, "Unsupported info code %d\n", x);
+	  fprintf (stderr, "Unsupported info code %lu\n", x);
 	  break;
 	}
       break;
@@ -401,8 +404,8 @@
       /* Reset */
       for (i = 0; i < 50; i++)
 	MYwrite_char(kidmum[1], RDP_Reset);
-      p = (char *) malloc(MAXHOSTNAMELENGTH + 5 + 20);
-      sprintf(p, "Running on %s:%d\n", localhost, socketnumber);
+      p = (unsigned char *) malloc(MAXHOSTNAMELENGTH + 5 + 20);
+      sprintf((char *)p, "Running on %s:%d\n", localhost, socketnumber);
       MYwrite_string(kidmum[1], p);
       free(p);
       
@@ -421,16 +424,11 @@
 /* in 'putinr0' with the data if appropriate. */
 int wait_for_osreply(ARMword *reply)
 {
-  char *p, *q;
-  int i, j, k;
-  unsigned char c, d, message;
-  ARMword x, y, z;
+  unsigned char *p;
+  int i, k;
+  unsigned char c, message;
+  ARMword x, y;
   struct sigaction action;
-  PointHandle point;
-  Dbg_ConfigBlock config;
-  Dbg_HostosInterface hostif;
-  struct Dbg_MCState *MCState;
-  char command_line[256];
   struct fd_set readfds;
   
 #ifdef DEBUG
@@ -468,7 +466,7 @@
       /* Read Memory Address */
       MYread_word(mumkid[0], &x); /* address */
       MYread_word(mumkid[0], &y); /* nbytes */
-      p = (char *) malloc(y);
+      p = (unsigned char *) malloc(y);
       i = armul_rdi.read(x, p, (unsigned *) &y);
       MYwrite_char(kidmum[1], RDP_Return);
       for (k = 0; k < y; k++)
@@ -483,7 +481,7 @@
       /* Write Memory Address */
       MYread_word(mumkid[0], &x); /* address */
       MYread_word(mumkid[0], &y); /* nbytes */
-      p = (char *) malloc(y);
+      p = (unsigned char *) malloc(y);
       for (k = 0; k < y; k++)
 	MYread_char(mumkid[0], &p[k]);
       i = armul_rdi.write(p, x, (unsigned *) &y);
@@ -497,7 +495,7 @@
     case RDP_OSOpReply :
       /* OS Operation Reply */
       MYread_char(mumkid[0], &c);
-      if (c == 1) MYread_char(mumkid[0], (char *) reply);
+      if (c == 1) MYread_char(mumkid[0], (unsigned char *) reply);
       if (c == 2) MYread_word(mumkid[0], reply);
       return c;
       break;
diff -u --recursive --new-file armul-1.0/main.c armul-1.0.1/main.c
--- armul-1.0/main.c	Fri Dec  9 13:33:10 1994
+++ armul-1.0.1/main.c	Tue Feb 25 18:26:25 1997
@@ -35,21 +35,6 @@
 
 #define MAXHOSTNAMELENGTH 64
 
-/* Read and write routines down sockets and pipes */
-
-void MYread_chars(int sock, void *p, int n);
-unsigned char MYread_char(int sock);
-ARMword MYread_word(int sock);
-void MYread_FPword(int sock, char *putinhere);
-
-void MYwrite_word(int sock, ARMword i);
-void MYwrite_string(int sock, char *s);
-void MYwrite_FPword(int sock, char *fromhere);
-void MYwrite_char(int sock, unsigned char c);
-
-void passon(int source, int dest, int n);
-
-
 /* Mother and child processes */
 void parent (void);
 void kid(void);
@@ -123,7 +108,7 @@
   for(i = 0; i < sizeof(devil.sin_zero); i++) devil.sin_zero[i] = '\000';
   memcpy(&devil.sin_addr, hp->h_addr_list[0], hp->h_length);
 
-  if (bind(sockethandle, &devil, sizeof(devil)) < 0) {
+  if (bind(sockethandle, (struct sockaddr *)&devil, sizeof(devil)) < 0) {
     perror("bind");
     return 1;
   }
@@ -137,7 +122,7 @@
 
   fprintf(stderr, "Waiting for connection from debugger...");
 
-  debugsock = accept(sockethandle, &isa, &i);
+  debugsock = accept(sockethandle, (struct sockaddr *)&isa, &i);
   if (debugsock < 0) {
     perror("accept");
     return 1;
diff -u --recursive --new-file armul-1.0/parent.c armul-1.0.1/parent.c
--- armul-1.0/parent.c	Fri Dec  9 13:51:16 1994
+++ armul-1.0.1/parent.c	Tue Feb 25 17:54:46 1997
@@ -24,6 +24,8 @@
 #include <stdio.h>
 #include <sys/types.h>
 #include <signal.h>
+#include <unistd.h>
+#include <sys/time.h>
 
 #include "armdefs.h"
 #include "dbg_rdi.h"
@@ -415,7 +417,7 @@
 	      break;
 
 	    default:
-	      fprintf (stderr, "Unrecognized RDIInfo request %d\n",
+	      fprintf (stderr, "Unrecognized RDIInfo request %lu\n",
 		       messagetype);
 	      goto panic_error;
 	    }
